<template>
	<!-- 提现界面 -->
	<view class="Withdraw">
		<view class="Withdraw_top">
			<view class="" style="margin-bottom: 40rpx;font-weight: bold;">
				提现到
			</view>
			<view class="d-flex d-flex-yCenter">
				<image src="../../static/icon/wechart_green.png" style="width: 42rpx;height: 36rpx;margin-right: 18rpx;"
					mode=""></image>
				<view class="" style="margin-right: 60rpx;margin-right: 60rpx;font-weight: bold;">
					微信
				</view>
				<view class="">
					<image src="../../static/icon/radio.png" style="width: 30rpx;height: 30rpx;" mode=""></image>
				</view>
			</view>
		</view>
		<!-- 提现金额 -->
		<view class="goto_mony">
			<view class="" style="margin-bottom: 70rpx;font-weight: bold;">
				提现金额
			</view>
			<view class="d-flex d-flex-yCenter" style="margin-bottom: 10rpx;">
				<image src="../../static/icon/daole.png" style="width: 34rpx;height: 44rpx;margin-right: 26rpx;"
					mode="">
				</image>
				<u-input v-model="value" :type="type" :border="border" placeholder="请输入提现金额" />
			</view>
			<view class="" style="width: 690rpx;height: 2rpx;background: #AEAEAE;margin-bottom: 20rpx;"></view>
			<view class="d-flex-yCenter-sb">
				<view class="d-flex">
					<view class="" style="font-weight: bold;">
						可提现金额：
					</view>
					<view class="colo_yello">
						{{userinfo.money}}
					</view>
				</view>
				<view class="color_ff bg_yello border-rs30 d-flex-yCenter-ju" style="padding:18rpx  14rpx ;"
					@click="gotomony">
					全部提现
				</view>
			</view>
			<view class="d-flex-yCenter-ju" style="
					width: 100%;height: 80rpx;margin-top: 100rpx;
					background: #FF9000;border-radius: 20px;font-weight: 500;
			        color: #FFFFFF;" @click="submit">
				提交申请
			</view>
		</view>

	</view>
</template>
<script>
	import {
		withdraw
	} from '@/config/apiRouter.js'

	import {
		mapGetters
	} from 'vuex'
	export default {
		data() {
			return {
				value: '',
			}
		},
		onShow() {
			console.log(this.userinfo)
		},
		computed: {
			...mapGetters(['userinfo'])
		},
		methods: {
			gotomony() {
				this.value = this.userinfo.money;
				console.log(this.value, 'value');
			},
			submit() {
				withdraw({
					money: this.value
				}).then(res => {
					this.$tool.showToast('申请成功',true)
					setTimeout(()=>{
						if (res.code == 200) {
							this.userMD.getUserData.apply(this);
						}
						this.$tool.navigateBack()
					},1500)
				})
			}
		}
	}
</script>

<style lang="scss">
	.Withdraw {
		height: 100vh;
		// background-color: #F5F5F5;
		background-color: #FFFFFF;

		.goto_mony {
			width: 750rpx;
			height: 1020rpx;
			padding: 30rpx;
			background: #FFFFFF;
			border-radius: 12px 12px 0px 0px;
		}


		.Withdraw_top {
			height: 188rpx;
			background-color: #F5F5F5;
			padding: 30rpx 0rpx 56rpx 28rpx;
		}
	}
</style>
